<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>配置插件参数</title>
<link href="__PUBLIC__/admin/css/xc.min.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/admin/css/xc.admin.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/lib/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/xc.js"></script> 
<script type="text/javascript" src="__PUBLIC__/admin/js/xc.admin.js"></script>
<script type="text/javascript" src="__PUBLIC__/lib/layer/layer.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/common-1.0.js"></script>
<style type="text/css">
.radio-box{ padding-left:0;}
</style>
</head>
<body>
<div class="pd-20">
  <div id="tab-system" class="HuiTab">
    <form action="" method="post" class="form form-horizontal" id="myform">
      <div class="tabCon">
      <volist name="reForm" id="vo">
        <if condition="($vo[fo_type] eq 'text')">
        <div class="row cl">
          <label class="form-label col-3"><span class="c-red">*</span>{$vo.fo_title}：</label>
          <div class="formControls col-8">
            <input type="text" id="{$vo.fo_name}" name="config[{$vo.fo_name}]" value="{$reValue[$vo['fo_name']]}" class="input-text">
          </div>
        </div>
        </if>
        <if condition="($vo[fo_type] eq 'radio')">
        <div class="row cl">
          <label class="form-label col-3"><span class="c-red">*</span>{$vo.fo_title}：</label>
          <div class="formControls col-8 skin-minimal">
            <volist name="vo.fo_area" id="vr" key="kr">
              <div class="radio-box">
              <input type="radio" id="{$vo.fo_name}{$kr}" name="config[{$vo.fo_name}]" value="{$kr}" <if condition="($reValue[$vo['fo_name']] eq $kr)">checked </if>/>
              <label for="{$vo.fo_name}{$kr}">{$vr}</label>
              </div>
            </volist>
          </div>
        </div>
        </if>
        <if condition="($vo[fo_type] eq 'select')">
        <div class="row cl">
          <label class="form-label col-3"><span class="c-red">*</span>{$vo.fo_title}：</label>
          <div class="formControls col-8">
            <span class="select-box col-3">
              <select name="config[{$vo.fo_name}]" class="select valid" size="1">
               <volist name="vo.fo_area" id="vs">
                 <option value="{$vs}" <if condition="($reValue[$vo['fo_area']] eq $vs)">selected</if>>{$vs}</option>
               </volist>
             </select>
		    </span>
          </div>
        </div>
        </if>
      </volist>
      <div class="row cl">
        <div class="col-9 col-offset-3">
          <input type="hidden" name="id" value="{$re.pl_id}">
      	  <button type="button" id="sub" name="sub" class="btn btn-primary radius" onClick="checkSubmit();"><i class='Hui-iconfont'>&#xe632;</i>&nbsp;保存</button>
          <button class="btn btn-default radius" type="button" onClick="layer_close();"><i class='Hui-iconfont'>&#xe66b;</i> 取消</button>
        </div>
      </div>
      </div>
    </form>
  </div>
</div>
</body>
<script>
//提交数据
function checkSubmit(){
$.ajax({
	type : 'post',
	url : '__MODULE__/Plugin/plugSet',
	data : $("#myform").serialize(),
	dataType : 'json',
	success : function(res){
		if(res.status == 1){
			layer.msg(res.msg,{icon:1},function(){
				// 先获取窗口索引，才能关闭窗口  
				var index = parent.layer.getFrameIndex(window.name);
				parent.layer.close(index);
			});
		   window.parent.location.reload(); //刷新父页面
		}else{
			layer.msg(res.msg, {icon: 2});
		}
	},
	error : function(XMLHttpRequest, textStatus, errorThrown) {
		layer.alert('网络失败，请刷新页面后重试',{icon:2});
	}
})
}
</script>
</html>